const JWTSECRET = require('./constent').JWTSECRET
const jwt = require('jsonwebtoken')
module.exports = {
    authOpt: function (req) {
        const companykey = 'kRRlcZ1Nu3GdBFEWV2l/V9G86oiwzjozYhZ9gofEooL7u87MT6kO3JYurdlCfn3VGvEPD+BhFqbD7KRBmB33rPD9FspgoymW6lX/WEVfrPqpU//ipIN/+c275wwcTl+2ETZmZK51JIPMPJZa6WL3Twx4ZPid82MgOyAQBwIu97g='
        let headers = {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer ' + jwt.sign({
                foo: 'bar'
            }, JWTSECRET),
            'C-key': companykey,
        }
        return {
            method: 'POST',
            url: req.url,
            data: JSON.stringify(req.data),
            headers: headers,
            json: true,
        }
    }
}
